package org.shilong.logic.party;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;

import org.shilong.Utilitys.Strings.Constants;
import org.shilong.mContext.db.DBContext;

public class AddPeopleWhoTakeInPartyLogic {
	
private static String rlt = null;
	
	public static String getRlt( String... args ){
		
		rlt = null;
		
		Connection conn = null;
		CallableStatement cst = null;
		
		conn = DBContext.createInstance( DBContext.TYPE_MYSQL ).getConnector();
		
		try {
			cst = conn.prepareCall( Constants.ADD_PARTY_PEOPLE );
			
			cst.setString(1, args[0]);	//	ac_name
			cst.setInt(2, Integer.valueOf(args[1]));	//pa_id
			cst.setString(3, args[2]);//	content 
			
			cst.registerOutParameter( 4, java.sql.Types.VARCHAR );
			
			cst.execute();
			
			rlt = cst.getString(4);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			
			try {
				cst.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			cst = null;
		}
		
		
		return rlt;
	}
}
